72 #define TIMER_PERIOD 80
77 WDT_A_hold(WDT_A_BASE);
86 GPIO_setAsPeripheralModuleFunctionInputPin(
89 GPIO_TERNARY_MODULE_FUNCTION);
119 ADC10_B_init(ADC10_B_BASE,
120 ADC10_B_SAMPLEHOLDSOURCE_SC,
121 ADC10_B_CLOCKSOURCE_ADC10OSC,
122 ADC10_B_CLOCKDIVIDER_1);
124 ADC10_B_enable(ADC10_B_BASE);
131 ADC10_B_setupSamplingTimer(ADC10_B_BASE,
132 ADC10_B_CYCLEHOLD_16_CYCLES,
133 ADC10_B_MULTIPLESAMPLESDISABLE);
142 ADC10_B_configureMemory(ADC10_B_BASE,
145 ADC10_B_VREFNEG_AVSS);
147 ADC10_B_clearInterrupt(ADC10_B_BASE,
151 ADC10_B_enableInterrupt(ADC10_B_BASE,
156 while ( REF_BUSY == Ref_isRefGenBusy(REF_BASE) ) ;
159 Ref_setReferenceVoltage(REF_BASE,
162 Ref_enableReferenceVoltage(REF_BASE);
165 Timer_A_initUpModeParam
param = {0};
166 param.clockSource = TIMER_A_CLOCKSOURCE_SMCLK;
167 param.clockSourceDivider = TIMER_A_CLOCKSOURCE_DIVIDER_1;
169 param.timerInterruptEnable_TAIE = TIMER_A_TAIE_INTERRUPT_DISABLE;
170 param.captureCompareInterruptEnable_CCR0_CCIE =
171 TIMER_A_CAPTURECOMPARE_INTERRUPT_ENABLE;
172 param.timerClear = TIMER_A_DO_CLEAR;
173 param.startTimer =
true;
174 Timer_A_initUpMode(TIMER_A0_BASE, &
param);
176 __bis_SR_register(CPUOFF + GIE);
187 ADC10_B_startConversion(ADC10_B_BASE,
188 ADC10_B_SINGLECHANNEL);
191 __bis_SR_register(CPUOFF + GIE);
200 #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
201 #pragma vector=ADC10_VECTOR
203 #elif defined(__GNUC__)
204 __attribute__((interrupt(ADC10_VECTOR)))
208 switch (__even_in_range(ADC10IV,12)){
219 if (ADC10_B_getResults(ADC10_B_BASE) < 0x155){
274 #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
275 #pragma vector=TIMER0_A0_VECTOR
277 #elif defined(__GNUC__)
278 __attribute__((interrupt(TIMER0_A0_VECTOR)))
MPU_initThreeSegmentsParam param
__bic_SR_register_on_exit(LPM3_bits|GIE)
GPIO_setOutputHighOnPin(GPIO_PORT_LED1|GPIO_PORT_LED2, GPIO_PIN_LED1|GPIO_PIN_LED2)
GPIO_setOutputLowOnPin(GPIO_PORT_LED1|GPIO_PORT_LED2, GPIO_PIN_LED1|GPIO_PIN_LED2)